package apps.softtech.Model;

import android.content.ContentValues;
import android.database.Cursor;

public class CategoryRequiredField {

	public static final String TABLE_NAME = "CategoryRequireField";
	
	public static final String CATEGORY_ID = "st_CategoryId";
	private int categoryId;

	public static final String TAG_ID = "st_TagId";
	private int tagId;

	public CategoryRequiredField() {
		super();
	}

	public CategoryRequiredField(int categoryId, int tagId) {
		super();
		this.categoryId = categoryId;
		this.tagId = tagId;
	}

	public int getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(int categoryId) {
		this.categoryId = categoryId;
	}

	public int getTagId() {
		return tagId;
	}

	public void setTagId(int tagId) {
		this.tagId = tagId;
	}
	
	/**
	 * get value of CategoryRequiredField
	 * @author MUI
	 * @return ContentValues
	 */
	public ContentValues getValueCategoryRequired(){
		ContentValues values = new ContentValues();
		values.put(CATEGORY_ID, this.getCategoryId());
		values.put(TAG_ID, this.getTagId());
		
		return values;
	}

	public void setValueFromCursor(Cursor c) {
		
		if (c.getColumnIndex(CATEGORY_ID) >= 0) {
			setCategoryId(c.getInt(c.getColumnIndex(CATEGORY_ID)));
		}
		if (c.getColumnIndex(TAG_ID) >= 0) {
			setTagId(c.getInt(c.getColumnIndex(TAG_ID)));
		}
		
	}
}
